Skip to content

Support .txt files in LLMFileAnalysisOperator - #70431

Merged
kaxil merged 1 commit into
apache:mainfrom
ColtenOuO:add-txt-file-analysis-support
Jul 27, 2026
Merged

Support .txt files in LLMFileAnalysisOperator#70431
kaxil merged 1 commit into
apache:mainfrom
ColtenOuO:add-txt-file-analysis-support

Conversation

@ColtenOuO

Copy link
Copy Markdown
Contributor

Summary

LLMFileAnalysisOperator rejects .txt files with LLMFileAnalysisUnsupportedFormatError, but a file with no extension
at all
(e.g. app) is already accepted and treated as plain text via the "log" fallback in detect_file_format(). The more explicitly-named file was the one that failed.

This also put LLMFileAnalysisOperator out of step with the rest of the provider:

  • DocumentLoaderOperator (this provider's other file-reading operator) already lists .txt as one of its built-in, zero-extra-dependency formats (EXTENSION_BACKEND_MAP: ".txt": "text").
  • Several of the provider's own example DAGs (example_llamaindex_rag.py, example_llamaindex_hook.py, example_langchain_tool_agent.py) ship .txt files as sample input for LLM-related tasks.

Changes

  • Add "txt" to SUPPORTED_FILE_FORMATS, _TEXT_LIKE_FORMATS, and _GZIP_SUPPORTED_FORMATS in utils/file_analysis.py.
  • No parsing/rendering logic changes: the existing generic text-renderingpath (_render_text_like, already used for .log and extension-less files) handles .txt as-is.

@kaxil
kaxil merged commit 9e00182 into apache:main Jul 27, 2026
83 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants